package com.openbravo.data.user;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Enumeration;
import java.util.Vector;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;

public class DirtyManager
  implements DocumentListener, ChangeListener, ActionListener, PropertyChangeListener
{
  private boolean m_bDirty = false;
  protected Vector listeners = new Vector();

  public void addDirtyListener(DirtyListener paramDirtyListener)
  {
    this.listeners.add(paramDirtyListener);
  }

  public void removeDirtyListener(DirtyListener paramDirtyListener)
  {
    this.listeners.remove(paramDirtyListener);
  }

  protected void fireChangedDirty()
  {
    Enumeration localEnumeration = this.listeners.elements();
    while (localEnumeration.hasMoreElements())
    {
      DirtyListener localDirtyListener = (DirtyListener)localEnumeration.nextElement();
      localDirtyListener.changedDirty(this.m_bDirty);
    }
  }

  public void setDirty(boolean paramBoolean)
  {
    if (this.m_bDirty != paramBoolean)
    {
      this.m_bDirty = paramBoolean;
      fireChangedDirty();
    }
  }

  public boolean isDirty()
  {
    return this.m_bDirty;
  }

  public void changedUpdate(DocumentEvent paramDocumentEvent)
  {
    setDirty(true);
  }

  public void insertUpdate(DocumentEvent paramDocumentEvent)
  {
    setDirty(true);
  }

  public void removeUpdate(DocumentEvent paramDocumentEvent)
  {
    setDirty(true);
  }

  public void stateChanged(ChangeEvent paramChangeEvent)
  {
    setDirty(true);
  }

  public void actionPerformed(ActionEvent paramActionEvent)
  {
    setDirty(true);
  }

  public void propertyChange(PropertyChangeEvent paramPropertyChangeEvent)
  {
    setDirty(true);
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.data.user.DirtyManager
 * JD-Core Version:    0.6.0
 */